// 学习数组的一些方法
// 复习强制类型转化四种方法

// Convert.ToType()
// Convert.Parse()
// Convert.TryParse()
// (type)
using System.IO;

namespace ABC
{
    internal class Kyujin
    {
        public static void Main(string[] args)
        {
            // Array.Clear()
            int[] arr1 = { 1, 3, 5 };
            Array.Clear(arr1, 0, 1);

            foreach (dynamic d in arr1)
            {
                Console.WriteLine(d);
            }

            // array.CopyTo() and Array.Copy()
            int[] saengil = { 1026, 1022, 1024 };
            int[] october = new int[8];
            saengil.CopyTo(october, 0);

            foreach (dynamic d in october)
            {
                Console.WriteLine(d + " English");
            }

            // self-teaching
            Console.WriteLine(october.GetLength(0));
            Console.WriteLine(october.Length);
            Console.WriteLine(october.IsFixedSize);
            Console.WriteLine(october.IsReadOnly);
            Console.WriteLine(october.LongLength);
            Console.WriteLine(october.IsSynchronized);

            //有些是Array.Method 有些是标识符.Method  真的好抽象啊。。。。。。。。
            Array.Sort(saengil);
            foreach (dynamic i in saengil)
            {
                Console.WriteLine(i);
            }

            Array.Reverse(saengil);
            foreach (dynamic i in saengil)
            {
                Console.WriteLine(i);
            }

            Console.WriteLine(Array.IndexOf(saengil, 10));

            // What thing will happen???
            Console.WriteLine(saengil.ToString());
            // saengil.SetValue(10, 10);
            // Within my expectation,index out of range
            saengil.SetValue(123567,2) ;
            foreach (dynamic i in saengil)
            {
                Console.WriteLine(i);
            }
        }
    }
}
